<template>
    <div class="newsinfo-container">
        <!-- 大标题 -->
        <h3 class="title">{{ title }}</h3>

        <!-- 子标题 -->
        <p class="subtitle">
            <span>发表时间: {{ createDate |dateFormat }}</span>
            <span>点击次数: {{ thumb }} 次</span>
        </p>
        <hr>

        <!-- 内容 -->
        <div class="content">{{ content }}</div>
        <br><br><br><br><br><br><br><br><br><br><br><br><br>
        <!-- 评论区域 -->

        <comment-box :id="this.id"></comment-box>
    </div>
</template>

<script>
import comment from '../subcomponents/comment.vue'


export default {
    data(){
        return {
            id: this.$route.params.id,
            content: this.$route.params.content,
            createDate:this.$route.params.createDate,
            thumb:this.$route.params.thumb,
            title: this.$route.params.title
        }
    },
    methods:{

    },
    components:{
        'comment-box': comment
    }
}
</script>

<style lang="scss" scoped>
.newsinfo-container{
    padding: 0 4px;
    .title{
        font-size: 16px;
        text-align: center;
        margin: 15px 0;
        color: red;
    }
    .subtitle{
        font-size: 13px;
        color: blue;
        display: flex;
        justify-content: space-between;
    }
    .content{
        color: pink;
    }
}
</style>